package com.yourcompany.struts.action;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import db.dbOperation;

public class userAction extends Action {
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String s_pagenow = request.getParameter("pagenow");
		
		try {
			int pagenow = Integer.parseInt(s_pagenow);
			dbOperation db = new dbOperation();
			ArrayList list = db.getUserList(pagenow);
			int pagecount = db.getPagecount();
			request.setAttribute("list", list);
			request.setAttribute("pagecount", pagecount+"");
			
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return mapping.findForward("success");
	}
	
}
